import axios from "./axios";

class Tenant {
    constructor(){}

    fetchLog(module:any, account:any, page:any, pageSize:any){
        return axios.post('/api/tenant/fetchLog', {module, account, page, pageSize});
    }
    
    fetchTenantInfo(){
        return axios.post('/api/tenant/fetchTenantInfo', {});
    }

    fetchTenantAccounts(account:any, nickname:any, page:any, pageSize:any){
        return axios.post('/api/tenant/user/fetchUser', {account, nickname, page, pageSize});
    }

    delTenantAccount(username:any){
        return axios.post('/api/tenant/user/delUser', {username});
    }

    addTenantAccount(username:any, nickname:any){
        return axios.post('/api/tenant/user/addUser', {username, nickname});
    }

    updateTenantAcount(username:any, nickname:any){
        return axios.post('/api/tenant/user/updateUser', {username, nickname});
    }

    updatePlan(plan:any){
        return axios.post('/api/tenant/updatePlan', {plan});
    }
    
    redeemPoints(points:any){
        return axios.post('/api/tenant/redeem', {points});
    }

    fetchTenantOrder(page:any, pageSize:any){
        return axios.post('/api/tenant/fetchTenantOrder', {page, pageSize});
    }

}

export default new Tenant();